{% if not is_xhr|default(false) %}{% extends "base.html" %}{% endif -%}
{% block content %}
    <div id="disks">
        <div class="box">
            <div class="box-header">
                <span>磁盘</span>
            </div>
            <div class="box-content">
                <table id="processes" class="table table-condensed">
                    <thead>
                        <tr>
                            <th>设备</th>
                            <th>挂载</th>
                            <th>文件系统</th>
                            <th>启动项</th>
                            <th>存储 (总计)</th>
                            <th>存储 (已用)</th>
                            <th>存储 (闲置)</th>
                        </tr>
                    </thead>
                    <tbody>
                            {% for d in disks %}
                            <tr>
                                <td>{{ d.device }}</td>
                                <td>{{ d.mountpoint }}</td>
                                <td>{{ d.type }}</td>
                                <td>{{ d.options }}</td>
                                <td>{{ d.space_total|filesizeformat }}</td>
                                <td>{{ d.space_used|filesizeformat }} ({{ d.space_used_percent }} %)</td>
                                <td>{{ d.space_free|filesizeformat }}</td>
                            </tr>
                            {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
        <div class="box">
            <div class="box-header">
                <span>磁盘 I/O</span>
            </div>
            <div class="box-content">
                <table id="processes" class="table">
                    <thead>
                        <tr>
                            <th>设备</th>
                            <th>读取总计</th>
                            <th>写入总计</th>
                            <th>读（字节）</th>
                            <th>写（字节）</th>
                            <th>读取时间 (ms)</th>
                            <th>写入时间 (ms)</th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for dev, io in io_counters %}
                        <tr>
                            <td>{{ dev }}</td>
                            <td>{{ io.read_count }}</td>
                            <td>{{ io.write_count }}</td>
                            <td>{{ io.read_bytes }}</td>
                            <td>{{ io.write_bytes }}</td>
                            <td>{{ io.read_time }}</td>
                            <td>{{ io.write_time }}</td>
                        </tr>
                        {% endfor %}
                    </tbody>
                </table>
            </div>
        </div>
    </div>
{% endblock %}
